version: '3.3'
services:


  db:
    image: postgres:13.0-alpine
    container_name: database_foodgram
    volumes:
      - pgdata:/var/lib/postgresql/data/
    env_file:
      - ./.env

  backend:
    image: lunarbirdmyt/foodgram_backend:latest
    container_name: backend_foodgram
    restart: always
    volumes:
      - static_value:/app_back/static/
      - media_value:/app_back/media/
    depends_on:
      - db
    env_file:
      - ./.env

  frontend:
    image: lunarbirdmyt/foodgram-frontend:latest
    container_name: frontend_foodgram
    volumes:
      - ../frontend/:/app/result_build/

  nginx:
    image: nginx:1.19.3
    container_name: nginx_foodgram
    ports:
      - "80:80"
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ../frontend/build:/usr/share/nginx/html/
      - ../docs/:/usr/share/nginx/html/api/docs/
      - static_value:/var/html/static/
      - media_value:/var/html/media/
    depends_on:
      - backend
volumes:
  pgdata:
  static_value:
  media_value:
